const express = require('express')
const router = express.Router()

// 导入控制层
const hostelsController = require('../controllers/hostelsController')
// 表单验证插件
const { body, query } = require("express-validator")
// 引入中间件
const checkPermission = require('../middleware/checkPermission');
const auth = require('../middleware/auth');

router.post('/add', auth, checkPermission("housekeep_info_add"), hostelsController.add)
router.get('/del_f', auth, checkPermission("housekeep_delete"), hostelsController.del_f)
router.get('/start', auth, checkPermission("housekeep_delete"), hostelsController.start)
router.get('/del_t', auth, checkPermission("housekeep_delete"), hostelsController.del_t)
router.get('/get', auth, checkPermission("housekeep_info_list"), hostelsController.get)
router.post('/set', auth, checkPermission("housekeep_info_edit"), hostelsController.set)
router.get('/list', auth, checkPermission("housekeep_info_list"), hostelsController.list)
router.post('/person_add', auth, checkPermission("housekeep_info_management_add"), hostelsController.person_add)
router.get('/person_del_f', auth, checkPermission("housekeep_info_management_delete"), hostelsController.person_del_f)
router.get('/person_del_t', auth, checkPermission("housekeep_info_management_delete"), hostelsController.person_del_t)
router.get('/person_get', auth, checkPermission("housekeep_info_management_list"), hostelsController.person_get)
router.post('/person_set', auth, checkPermission("housekeep_info_management_edit"), hostelsController.person_set)
router.get('/person_list', auth, checkPermission("housekeep_info_management_list"), hostelsController.person_list)
router.get('/clsToprm', auth, checkPermission("housekeep_info_list"), hostelsController.clsToprm)
module.exports = router